<template>
  <div>

    <div v-show="justSee">
      <div v-html="html" class="paddingLi"></div>
    </div>
    
    <!-- OA自动化提交框 -->
    <div v-show="!justSee">
      <div class=" tempFW " >
        <div class="marginB5">
          <WangEditor ref="WangEditor" v-model="html"   />
          <!-- <div>温馨提示：从word拷贝，粘贴进来，会带有隐形的特殊字符，导致交官失败。系统会清空原数据格式。</div> -->

          <!-- <div class="paddingT10">
            <Button type="primary" @click="getHtml" >获取文字类容</Button>
            <Button type="default" @click="getText" >获取纯text内容</Button>
            
            <Button type="info" @click="setHtml" >设置内容</Button>
            <Button type="error" @click="clearHtml" >清除文本</Button>
          </div> -->
        </div>
      </div>
    </div>
    
    
  </div>
</template>


<style lang="less" >
.tempFW{
  .w-e-text-container {
    height: 400px !important;
  }
  
}
</style>


<script>
import WangEditor from '@$@/_tool/wangEditor'
export default {
  name: "oAone22",
  components: {
    WangEditor
  },
  data() {
    let data = {
      html:''
    };
    let tool = {
      justSee:false
    };
    return Object.assign(data, tool);
  },
  watch:{
    justSee(newVal,oldVal){
      if(newVal){
        this.disabled();//禁用补正框
      }
      // console.log('newVal = ',newVal)
    }
  },
  mounted() {},
  methods: {

    getHtml(){
      return (this.html);
    },
    clearHtml(){
      this.$refs['WangEditor'].clear();
      // console.log('清空')
    },
    setHtml(setHtml){
      this.$refs['WangEditor'].setHtml(setHtml);
      // console.log(this.html)
    },
    tShow(i){
      this.buZList[i].show=!this.buZList[i].show;
    },
    disabled(){
      //禁止使用编辑器
      this.$refs['WangEditor'].editor.$textElem.attr('contenteditable', false)
    },

    //获取纯文字
    getText(){
      let out=this.$refs['WangEditor'].editor.txt.text();
      return out;
    }
  }
};
</script>

